#include <math.h>
#include <stdlib.h>
#include <string>
#include <iostream>

using std::string;
using std::cout;

int main(){	
	try{
		if(rand()%2==0)
			throw 42;
		else
			throw "note this";
	}catch(const int val){
		printf("catch int %d",val);
	}catch(const string& s){
		cout<<"catch string:"<<s<<"\n";
	}catch(...){
		cout<<" not catched"<<"\n";
	}
	return 0;
}
